﻿<%@ Page Language="C#" ValidateRequest="false" AutoEventWireup="true" CodeFile="tab_DataSource_Add.aspx.cs" Inherits="AdminCMS_tab_DataSource_Add" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>添加数据源</title>    
</head>
<body style="text-align:center;">
<link id="mylink" href="css/style<%=UIMethod.GetStyleValue()%>.css" type="text/css" rel="stylesheet"/>

<form id="form1" runat="server">

<div style="width:720px;">
	<div class="title_right2" style="padding-left:35px; padding-top:5px; text-align:left;">
		<span class="title_maintxt"><b>添加数据源</b></span>
	</div>	
	<table cellSpacing="0" cellPadding="0" width="100%" class="border">
		<tr>
			<td style="text-align:right; width:120px; height:30px;" class="tdbg_left">描述：</td>
			<td style="text-align:left;">
			<asp:TextBox ID="src_Description" runat="server" Width="300"></asp:TextBox>
    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="src_Description">不能为空</asp:RequiredFieldValidator>
			</td>
		</tr>
		<tr>
			<td style="text-align:right; width:120px; height:30px;" class="tdbg_left">数据库类型：</td>
			<td style="text-align:left;">
			    <asp:DropDownList ID="src_DataBaseType" runat="server" onchange="ChangeEvent();"></asp:DropDownList>
			    
			    &nbsp;
			    <asp:CheckBox runat="server" ID="src_IsConfig" Text="系统配制" />
			    	
			</td>
		</tr>
		<tr>
			<td style="text-align:right; width:120px; height:30px;" class="tdbg_left">连接字符串：</td>
			<td style="text-align:left;">
			<asp:TextBox ID="src_ConnectionString" runat="server" Width="300px">Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\Database.mdb;</asp:TextBox>
    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="src_Description">不能为空</asp:RequiredFieldValidator>
			</td>
		</tr>
		<tr>
			<td style="text-align:right; width:120px; height:30px;" class="tdbg_left">查询语句：</td>
			<td style="text-align:left;">
			<asp:TextBox ID="src_SelectText" runat="server" Height="250px" TextMode="MultiLine" Width="500px"></asp:TextBox>
    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="src_SelectText">*</asp:RequiredFieldValidator>
			</td>
		</tr>         

		<tr>
			<td></td>
			<td style="text-align:left; height:50px;">
			<asp:Button ID="btn_submit" runat="server" Text="确定" OnClick="btn_submit_Click" />
			</td>
		</tr>
	</table>
<!-- 信息添加块 end-->
<!--阴影-->
	<div style="width:98%;" class="tdbg_left2">
	</div>
	<!--阴影end-->
</div>
</form>
</body>
</html>
<script type="text/javascript">
function ChangeEvent()
{
    var ddl_value = document.getElementById("src_DataBaseType").value;
    var txt_obj = document.getElementById("src_ConnectionString");
    
    switch(ddl_value)
    {
        case "0":
            txt_obj.value = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\Database.mdb;";
            break;
        case "1":
            txt_obj.value = "Data Source=.;Initial Catalog=pubs;Integrated Security=SSPI;";
            break;
    }
}
</script>